<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>后台管理</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
</head>
<body class="layui-layout-body">

<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">后台管理页面</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="">控制台</a></li>
            <li class="layui-nav-item"><a href="">商品管理</a></li>
            <li class="layui-nav-item"><a href="">用户</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;">其它系统</a>
                <dl class="layui-nav-child">
                    <dd><a href="">邮件管理</a></dd>
                    <dd><a href="">消息管理</a></dd>
                    <dd><a href="">授权管理</a></dd>
                </dl>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="login.html" id="UserName">
<!--                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">-->
                   haha
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a onclick="out()">退出</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">所有商品</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/admin/getAllCar.html">车辆列表</a></dd>
<!--                        <dd><a href="addNewCar.html">新增</a></dd>-->
<!--                        <dd><a href="updateCarIno.html">编辑</a></dd>-->
                        <dd><a href="">超链接</a></dd>
                    </dl>
                </li>
            </ul>
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">注册用户</a>
                    <dl class="layui-nav-child">
                        <dd><a href="admin/getAllCustoms.html">用户列表</a></dd>
                        <!--                        <dd><a href="addNewCar.html">新增</a></dd>-->
                        <!--                        <dd><a href="updateCarIno.html">编辑</a></dd>-->

                    </dl>
                </li>
            </ul>
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">支持城市</a>
                    <dl class="layui-nav-child">
                        <dd><a href="admin/getAllCitys.html">城市列表</a></dd>
                        <!--                        <dd><a href="addNewCar.html">新增</a></dd>-->
                        <!--                        <dd><a href="updateCarIno.html">编辑</a></dd>-->

                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body" id="main">
        <!-- 内容主体区域 -->

        <iframe id="iframeMain" src="" style="width: 100% "; height="100%";></iframe>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © layui.com - 底部固定区域
    </div>
</div>
<script src="/layui/layui.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;
        var name = window.localStorage.getItem("name");
        $("#UserName").text("你好"+name);

    });
    function openRight(url) {
        $("#main").load(url);
    }
    $(document).ready(function(){
        $('dd>a').click(function (e) {
            e.preventDefault();
            $("#iframeMain").attr('src',$(this).attr('href'));
        });

    });
    function out() {
        var result = confirm("确定要退出吗？");
        console.log(result);
        if(result){
            location.href="/logout";
        }

    }
</script>
</body>
</html>
